#ifndef JOINT_QUEUE_H
#define JOINT_QUEUE_H
#include "../motion9_dll.h"

typedef struct{
	double posit[MAX_JOINT];
	float vl[MAX_JOINT];
	char active;
}STRUCT_JOINT_SEGMENT;

typedef struct {
	STRUCT_JOINT_SEGMENT *queue;	/* ptr to the tcs */
	int size;			/* size of queue */
	int _len;			/* number of tcs now in queue */
	int start, end;		/* indices to next to get, next to put */
	int allFull;		/* flag meaning it's actually full */
}STRUCT_JOINT_QUEUE;

int jcqCreate(STRUCT_JOINT_QUEUE * const tcq, int _size, STRUCT_JOINT_SEGMENT * const tcSpace);
int jcqDelete(STRUCT_JOINT_QUEUE * const tcq);
int jcqInit(STRUCT_JOINT_QUEUE * const tcq);
int jcqPut(STRUCT_JOINT_QUEUE * const tcq, STRUCT_JOINT_SEGMENT const * const tc);
int jcqPopBack(STRUCT_JOINT_QUEUE * const tcq);
int jcqRemove(STRUCT_JOINT_QUEUE * const tcq, int n);
int jcqLen(STRUCT_JOINT_QUEUE const * const tcq);
STRUCT_JOINT_SEGMENT * jcqItem(STRUCT_JOINT_QUEUE const * const tcq, int n);
STRUCT_JOINT_SEGMENT * jcqLast(STRUCT_JOINT_QUEUE const * const tcq);
int jcqFull(STRUCT_JOINT_QUEUE const * const tcq);


#endif
